<?php

use Illuminate\Support\Facades\Route;
use App\Http\Controllers\Home\HomeController;
use App\Http\Controllers\Admin\LoginController;
use App\Http\Controllers\Admin\ManageController;
use App\Http\Controllers\Admin\MiniappsController;
use App\Http\Controllers\Admin\UsersController;
use App\Http\Controllers\Admin\ArticleController;
use App\Http\Controllers\Admin\OrderController;
use App\Http\Controllers\Admin\TemplateController;
use App\Http\Controllers\Admin\MiniappController;
use App\Http\Controllers\Home\WebController;
use App\Http\Controllers\Home\CardController;
use App\Http\Controllers\Home\PayController;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
Route::get("/", [HomeController::class,"webIndex"]);
Route::get("app", [HomeController::class,"appIndex"]);
Route::get("glogin", [HomeController::class,"getLoginUrl"]);

Route::group(['prefix' => 'admin'], function() {
	Route::get('login', [LoginController::class,'login'])->name("login");
	Route::post('login', [LoginController::class,'loginSubmit']);
	Route::get('login_token', [LoginController::class,'loginToken']);
	Route::get('mp_login', [LoginController::class,'mpLogin']); //公众号登录
	Route::get('logout', [LoginController::class,'loginOut']);
	Route::get('order/pc_pay', [OrderController::class,'pcPay']);
	Route::group(['middleware' => ['adminauth', 'web', 'auth']], function () {
		Route::group(['prefix' => 'template'], function() {
			Route::get('mini', [TemplateController::class,'templateMini']);
			Route::get('template_person', [TemplateController::class,'templatePerson']);
			Route::get('template_mini', [TemplateController::class,'jstemplateMini']);
			Route::get('mini_add', [TemplateController::class,'templateMiniAdd']);
			Route::get('mini_delete', [TemplateController::class,'templateMiniDelete']);
			Route::get('mini_add_submit', [TemplateController::class,'templateMiniAddSubmit']);
			Route::get('mini_update/{id}', [TemplateController::class,'templateMiniUpdate']);
			Route::get('mini_update_submit', [TemplateController::class,'templateMiniUpdateSubmit']);
			Route::get('admin', [TemplateController::class,'templateAdmin']);
			Route::get('admin_add', [TemplateController::class,'templateAdminAdd']);
			Route::get('admin_delete', [TemplateController::class,'templateAdminDelete']);
			Route::get('admin_add_submit', [TemplateController::class,'templateAdminAddSubmit']);
			Route::get('admin_update/{id}', [TemplateController::class,'templateAdminUpdate']);
			Route::get('admin_update_submit', [TemplateController::class,'templateAdminUpdateSubmit']);

			Route::get('beian', [TemplateController::class,'templateBeian']);
			Route::get('beian_add', [TemplateController::class,'templateBeianAdd']);
			Route::get('beian_add_submit', [TemplateController::class,'templateBeianAddSubmit']);
			Route::get('beian_update/{id}', [TemplateController::class,'templateBeianUpdate']);
			Route::get('beian_update_submit', [TemplateController::class,'templateBeianUpdateSubmit']);
		});

		Route::group(['prefix' => 'article'], function() {
			Route::get('detial/{id}', [ArticleController::class,'articleDetial']);
		});

		Route::group(['prefix' => 'order'], function() {
			Route::get('list', [OrderController::class,'list']);
			Route::get('key', [OrderController::class,'key']);
			Route::get('key_active', [OrderController::class,'keyActive']);
			Route::get('pay', [OrderController::class,'pay']);
			Route::get('pay_submit', [OrderController::class,'paySubmit']);
			Route::get('pay_status', [OrderController::class,'payStatus']);
		});

		Route::group(['prefix' => 'miniapp'], function() {
			Route::get('service', [MiniappController::class,'miniappService']);
			Route::get('miniapp_last', [MiniappController::class,'miniappLast']);
			Route::get('miniapp_list', [MiniappController::class,'miniappList']);
			Route::get('miniapp_bind', [MiniappController::class,'miniappBind']);
			Route::get('minapp_add', [MiniappController::class,'minappAdd']);
			Route::get('minapp_add_submit', [MiniappController::class,'minappAddSubmit']);
			Route::get('minapp_update/{appid}', [MiniappController::class,'minappUpdate']);
			Route::post('minapp_update/{appid}', [MiniappController::class,'minappUpdateSubmit']);
			Route::get('minapp_disable/{appid}', [MiniappController::class,'minappDisable']);
			Route::get('minapp_delete', [MiniappController::class,'minappDelete']);
			Route::get('minapp_default/{appid}', [MiniappController::class,'minappDefault']);
			Route::get('minapp_scene/{appid}', [MiniappController::class,'minappScene']);
			Route::get('minapp_change', [MiniappController::class,'minappChange']);
			Route::post('minapp_change', [MiniappController::class,'minappChangeSubmit']);
			Route::get('miniapp_bind_scan', [MiniappController::class,'miniappBindScan']);
            Route::get('miniapp_bind_scan_back', [MiniappController::class,'miniappBindScanBack']);
            Route::get('miniapp_check_bind', [MiniappController::class,'miniappCheckBind']);
            Route::get('miniapp_check_bind_back/{appid}', [MiniappController::class,'miniappCheckBindBack']);
            Route::get('miniapp_beian', [MiniappController::class,'miniappBeian']);
            Route::get('miniapp_beian_image', [MiniappController::class,'miniappBeianImage']);
            Route::get('miniapp_beian_verify', [MiniappController::class,'miniappBeianVerify']);
            Route::get('miniapp_beian_verify_check', [MiniappController::class,'miniappBeianVerifyCheck']);
            Route::post('miniapp_beian_submit', [MiniappController::class,'miniappBeianSubmit']);
            Route::get('miniapp_beian_result/{appid}', [MiniappController::class,'miniappBeianResult']);
		});

		Route::group(['prefix' => 'users'], function() {
			Route::get('users_center', [HomeController::class,'usersCenter']);
			Route::get('users_phone', [UsersController::class,'usersPhone']);
			Route::post('users_phone', [UsersController::class,'usersPhoneSubmit']);
			Route::post('users_add', [UsersController::class,'usersAddSubmit']);
			Route::get('users_orders_lists', [UsersController::class,'usersOrdersLists']);
			Route::get('member_orders_repay/{id}', [UsersController::class,'memberOrdersRePay']);
			Route::get('member_orders_invoice', [UsersController::class,'memberOrdersInvoice']); // 申请发票
			Route::post('member_orders_invoice', [UsersController::class,'memberOrdersInvoiceSubmit']); // 申请发票
			Route::get('users_invoice', [UsersController::class,'usersInvoice']); // 申请发票记录
			Route::post('users_invoice_detial', [UsersController::class,'usersInvoiceDetial']);
			Route::any('alipayBack', [UsersController::class,'alipayBack']);
			Route::any('agent_code', [UsersController::class,'agentCode']);
			Route::post('withdrawal', [UsersController::class,'withdrawal']);	// 用户提现
			Route::get('users_withdrawals', [UsersController::class,'usersWithdrawalLists']);	// 用户提现记录

			Route::get('wechat_bind', [UsersController::class,'wechatBind']);
			Route::get('wechat_bind_back', [UsersController::class,'wechatBindBack']);

			Route::get('reset_password', [UsersController::class,'resetPassword']); // 修改密码
			Route::post('reset_password', [UsersController::class,'resetPasswordSubmit']); // 提交修改密码
			Route::get('remarks_add', [UsersController::class,'remarksAdd']);	// 添加用户备注
			Route::get('update_status', [UsersController::class,'updateStatus']);	// 更新跟进状态
			Route::get('users_detial/{id?}', [UsersController::class,'usersDetial']); // 用户详情
			Route::get('api_users_detial/{id?}', [UsersController::class,'apiUsersDetial']); // 用户详情

			Route::get('links_lists_images', [UsersController::class,'linksListsImages']); // 违规图片记录
			Route::get('users_authority/{users_id?}', [UsersController::class,'usersAuthority']); // 修改用户权限
			Route::post('users_authority/{users_id?}', [UsersController::class,'usersAuthoritySubmit']); // 修改用户权限
			Route::get('users_qrcode_lists', [UsersController::class,'usersQrcodeLists']); //二维码更新记录

			Route::get('users_update/{users_id?}', [UsersController::class,'usersUpdate']);
			Route::post('users_update/{users_id?}', [UsersController::class,'usersUpdateSubmit']);

			Route::get('domain_list', [UsersController::class,'domainList']);
			Route::get('domain_add', [UsersController::class,'domainAdd']);
			Route::get('domain_add_submit', [UsersController::class,'domainAddSubmit']);
			Route::get('domain_delete/{id}', [UsersController::class,'domainDelete']);
		});

		Route::group(['prefix' => 'pay'], function() {
			Route::get('wechat_qrcode',[PayController::class,'wechatQrcode']); // 生成微信支付二维码
			Route::get('wechat_qrcode_status',[PayController::class,'wechatQrcodeStatus']); // 微信支付状态
		});

		Route::group(['prefix' => 'miniapps'], function() {
			Route::get('miniapp_lists', [MiniappsController::class,'miniappLists']);
            Route::get('miniapp_register', [MiniappsController::class,'miniappRegister']); // 创建小程序
            Route::get('miniapps_order', [MiniappsController::class,'miniappOrder']);
            Route::get('miniapp_register_gzh', [MiniappsController::class,'miniappRegisterGzh']); //公众号注册小程序
            Route::get('miniapp_register_gzh_back/{appid}', [MiniappsController::class,'miniappRegisterGzhBack']); //公众号注册小程序返回
			Route::get("wxaauth/{appid}", [MiniappsController::class,"wxaAuth"]);//认证小程序
			Route::post("wxaauth/{appid}", [MiniappController::class,"wxaAuthSubmit"]);//认证小程序
            Route::get('official_list', [MiniappsController::class,'officialList']);
			Route::get('official_detial/{appid}', [MiniappsController::class,'officialDetial']);
            Route::get('official_bind', [MiniappsController::class,'officialBind']); //绑定公众号
            Route::get('official_bind_back', [MiniappsController::class,'officialBindBack']); //绑定公众号返回
            Route::get('official_delete/{appid}', [MiniappsController::class,'officialDelete']);
            Route::get('miniapp_delete/{id}', [MiniappsController::class,'miniappDelete']);

            Route::get('miniapp_register_corp', [MiniappsController::class,'miniappRegisterCrop']); //企业小程序注册
            Route::get('miniapp_register_corp_submit', [MiniappsController::class,'miniappRegisterCropSubmit']); //企业小程序注册
            Route::get('miniapp_register_person', [MiniappsController::class,'miniappRegisterPerson']); //个人小程序注册
            Route::get('miniapp_register_person_submit', [MiniappsController::class,'miniappRegisterPersonSubmit']); //个人小程序注册
            Route::get('examine_pass/{id}', [MiniappsController::class,'examinePass']); // 通过小程序初审
            Route::get('component_rebind_admin_back/{appid}', [MiniappsController::class,'componentRebindAdminBack']); //换绑小程序管理员

            Route::get('fast_register_betaweapp', [MiniappsController::class,'fastRegisterBetaweapp']); //创建试用小程序
            Route::post('fast_register_betaweapp', [MiniappsController::class,'fastRegisterBetaweappSubmit']); //创建试用小程序
            Route::get('fast_register_betaweapp_event/{unique_id}', [MiniappsController::class,'fastRegisterBetaWeappEvent']); // 试用小程序授权状态
            Route::get('betaweapp_status/{unique_id}', [MiniappsController::class,'betaweappStatus']); //小程序状态

            Route::get('miniapp_publish/{appid}', [MiniappsController::class,'minappPublish']); // 客户发布微信小程序
            Route::get('miniapp_publish_submit', [MiniappsController::class,'minappPublisSubmit']); // 客户发布微信小程序
            Route::get('get_illegal_records/{appid}', [MiniappsController::class,'getIllegalRecords']); // 小程序违规处罚记录

            Route::get('change_wxa_search_status/{appid}', [MiniappsController::class,'changeWxaSearchStatus']); // 查询小程序搜索设置
            Route::post('change_wxa_search_status/{appid}', [MiniappsController::class,'changeWxaSearchStatusSubmit']); // 查询小程序搜索设置

            Route::get('weapp_status/{appid}', [MiniappsController::class,'weappStatus']); //小程序状态
            Route::get('miniapp_audit_cancel/{appid}', [MiniappsController::class,'miniappAuditCancel']); //小程序状态
            Route::get('verify_beta_weapp/{unique_id}', [MiniappsController::class,'verifyBetaWeappView']);
            Route::post('verify_beta_weapp/{unique_id}', [MiniappsController::class,'verifyBetaWeapp']); // 试用小程序快速认证

            Route::get('weapp_audit/{appid}', [MiniappsController::class,'weappAudit']); // 小程序代码审核
            Route::any('wxa_commit/{unique_id}', [MiniappsController::class,'wxaCommit']); // 上传代码
            Route::get('wxa_recommit/{unique_id}', [MiniappsController::class,'wxaReCommit']); // 被拒重新提交
            Route::get('wxa_release/{unique_id}', [MiniappsController::class,'wxaRelease']); // 发布已通过审核的小程序

            Route::get('miniapp_detial/{appid}', [MiniappsController::class,'miniappDetial']); //获取小程序基本信息
			Route::get('mini_remark', [MiniappsController::class,'miniRemark']);
			Route::get('miniapp_get_mail', [MiniappsController::class,'miniappGetMail']);//获取邮箱
			Route::get('miniapp_change_mail', [MiniappsController::class,'miniappChangeMail']);//获取邮箱
            Route::get('miniapp_bind_mail', [MiniappsController::class,'miniappBindMail']);//绑定邮箱
            Route::get('miniapp_error/{id}', [MiniappsController::class,'miniappError']);
            Route::get('wxa_modify_domain/{appid}', [MiniappsController::class,'wxaModifyDomain']); //设置服务器域名
            Route::post('wxa_modify_domain/{appid}', [MiniappsController::class,'wxaModifyDomainSubmit']); //设置服务器域名
            Route::get('wxa_webview_domain/{appid}', [MiniappsController::class,'wxaWebviewDomain']); //设置业务域名
            Route::post('wxa_webview_domain/{appid}', [MiniappsController::class,'wxaWebviewDomainSubmit']); //设置业务域名

            Route::get('miniapp_bind', [MiniappsController::class,'miniappBind']); // 自有小程序绑定
            Route::get('miniapp_bind_back', [MiniappsController::class,'miniappBindBack']); // 自有小程序绑定回调
            Route::get('official_push', [MiniappsController::class,'officialPush']);//通知消息
            Route::post('official_push', [MiniappsController::class,'officialPushSubmit']);
        });
	});
});
